package com.controller;

import javax.xml.ws.RequestMapping;

@Controller
public class productController {
   // @RequestMapping("/getProducts")
   // public void getProducts(String[] proIds) {
   //     for (String proId : proIds) {
   //         System.out.println("获取到了Id为"+proId+"的商品");
    //    }
   // }
    @RequestMapping("/getProducts")
    public void Products(@RequestParam("proIds") List<String> proIds) {
        for (String proId : proIds) {
            System.out.println("获取到了Id为"+proId+"的商品");
        }
    }

    @RequestMapping("/getProduct")
    public void getProduct(@RequestBody Product product){
        String proId = product.getProId();
        String proName = product.getProName();
        System.out.println("获取到的Id为" + proId + "名称为"+proName +"的商品");
    }
    @RequestMapping("/getProductList")
    public void getProductList(@RequestBody List<Product> products){
        for (Product product : products) {
            String proId = product.getProId();
            String proName = product.getProName();
            System.out.println("获取到的Id为" + proId + "名称为"+proName +"的商品");
        }
    }
}
